

#ifndef SELECTMATERIALDATADIALOG_H
#define SELECTMATERIALDATADIALOG_H

#include <QDialog>
#include <ui_selectmaterialdatawidget.h>
#include <materialdatalistmodel.h>
#include <QSortFilterProxyModel>

class SelectMaterialDataDialog : public QDialog
{
  Q_OBJECT
private:
  Ui::SelectMaterialDataWidget  _gui;
  MaterialDataListModel         *_model;
  MaterialDataDelegator         *_delegator;
  QSortFilterProxyModel         *_filterProxy;

  bool                          _cleared;
  MaterialData                  *_data;

private slots:
  void SelectionChanged (QModelIndex index, QModelIndex);
  void on_listViewMaterialData_doubleClicked (QModelIndex);
  void on_lineEditFilter_textChanged (const QString &text);
  void on_pushButtonClear_clicked ();

public:
  SelectMaterialDataDialog(QWidget *parent = 0);
  void SetDelegator (MaterialDataDelegator* delegator);

  void SetClearButtonVisible (bool visible);

  MaterialData* GetData ();

  bool IsCleared ();

};

#endif // SELECTMATERIALDATADIALOG_H
